/*
    author: SS
*/

var express = require('express')
var router = require('./router')
var adminR = require('./adminrouter')
var bodyParser = require('body-parser')
var mongoose = require('mongoose')
var app = express()
var adminApp= express()
adminApp.engine('html', require('express-art-template'))
adminApp.use(bodyParser.urlencoded({extended: false}))
adminApp.use(bodyParser.json())
adminApp.use('/node_modules/', express.static('./node_modules/'))
adminApp.use('/public/', express.static('./public/'))
adminApp.use(adminR)

app.use(express.json())
app.use('/node_modules/', express.static('./node_modules/'))
app.use('/public/', express.static('./public/'))
app.use(router)


app.listen(8000, (error) => {
    if (error) {
        console.log(error);
    } else {
        console.log('8000 server is running');
    }
    
})

adminApp.listen(8001, (error) => {
    if (error) {
        console.log(error);
    } else {
        console.log('8001 server is running');
    }
    
})